<!--#include("include.header.html")-->

<div class="list">

    <h3>{$lang->cmd_manage_package}</h3>
    <p class="information">
        {$lang->about_manage_package}
        <form action="./" method="get" class="statusSelect">
            <input type="hidden" name="vid" value="{$vid}" />
            <input type="hidden" name="mid" value="{$mid}" />
            <input type="hidden" name="page" value="{$page}" />
            <input type="hidden" name="act" value="{$act}" />
            <select name="category_srl" onchange="location.href=location.href.setQuery('category_srl',this.options[this.selectedIndex].value);return false;">
                <option value="">{$lang->package_category}</option>
            {@ $_curDepth = 0; }
            <!--@foreach($categories as $key => $val)-->
                <!--@if($val->depth<$_curDepth)-->
                </optgroup>
                <!--@end-->
                <!--@if($val->depth<1)-->
                <!--@if($val->child_count>0)-->
                <optgroup label="{$val->title}">
                <!--@else-->
                <option value="{$val->category_srl}" <!--@if($category_srl == $val->category_srl)-->selected="selected"<!--@end-->>{$val->title}</option>
                <!--@end-->
                <!--@end-->
                <!--@if($val->depth>0)-->
                    <option value="{$val->category_srl}" <!--@if($category_srl == $val->category_srl)-->selected="selected"<!--@end-->>{$val->title}</option>
                <!--@end-->
                {@ $_curDepth = $val->depth}
            <!--@end-->
            <!--@for($i=0;$i<$_curDepth;$i++)--></optgroup><!--@end-->
            </select>
            <select name="status" onchange="location.href=location.href.setQuery('status',this.options[this.selectedIndex].value);return false;">
                <option value="" <!--@if(!$status)-->selected="selected"<!--@end-->>{$lang->package_status}</option>
                <option value="waiting" <!--@if($status=='waiting')-->selected="selected"<!--@end-->>{$lang->package_waiting}</option>
                <option value="accepted" <!--@if($status=='accepted')-->selected="selected"<!--@end-->>{$lang->package_accepted}</option>
                <option value="reservation" <!--@if($status=='reservation')-->selected="selected"<!--@end-->>{$lang->package_reservation}</option>
            </select>
        </form>
    </p>

    <!--@foreach($package_list as $key => $val)-->
    <table width="100%" cellspacing="0" cellpadding="0" class="view_type1">
    <colgroup>
    <col width="100" /><col /><col width="100" /><col /><col width="100" /><col />
    </colgroup>
    <tr>
        <th scope="row">{$lang->package_title}</th>
        <td>{$val->title}</td>
        <th scope="row">{$lang->package_category}</th>
        <td>{$categories[$val->category_srl]->title}</td>
        <th scope="row">{$lang->regdate}</th>
        <td class="date">{zdate($val->regdate, "Y-m-d H:i")}</td>
    </tr>
    <tr>
        <!--@if($module_info->resource_use_path=='Y')-->
        <th scope="row">{$lang->package_path}</th>
        <td colspan="3">{$val->path}</td>
        <td colspan="2" class="left"><!--@if($val->homepage)--><a href="{$val->homepage}">{$val->homepage}</a><!--@else-->&nbsp;<!--@end--></td>
        <!--@else-->
        <th scope="row">{$lang->homepage}</th>
        <td colspan="5" class="left"><!--@if($val->homepage)--><a href="{$val->homepage}">{$val->homepage}</a><!--@else-->&nbsp;<!--@end--></td>
        <!--@end-->
    </tr>
    <tr>
        <th scope="row" rowspan="2">{$lang->package_description}</th>
        <td colspan="3" rowspan="2">{nl2br($val->description)}</td>
        <td colspan="2" class="left"><a href="#" class="member_{$val->member_srl}" onclick="return false;">{$val->nick_name}</a></td>
    </tr>
    <tr>
        <td scope="row" colspan="2" class="center">
            <form action="./" method="get" onsubmit="return procFilter(this,change_status);">
                <input type="hidden" name="vid" value="{$vid}" />
                <input type="hidden" name="mid" value="{$mid}" />
                <input type="hidden" name="page" value="{$page}" />
                <input type="hidden" name="package_srl" value="{$val->package_srl}" />
                <select name="status">
                    <option value="waiting" <!--@if($val->status=='waiting')-->selected="selected"<!--@end-->>{$lang->package_waiting}</option>
                    <option value="accepted" <!--@if($val->status=='accepted')-->selected="selected"<!--@end-->>{$lang->package_accepted}</option>
                    <option value="reservation" <!--@if($val->status=='reservation')-->selected="selected"<!--@end-->>{$lang->package_reservation}</option>
                </select>
                <span class="button black"><input type="submit" value="{$lang->cmd_apply}" /></span>
                <span class="button red"><input type="button" onclick="if(confirm('{$lang->confirm_delete}')) doDeletePackage({$val->package_srl}); return false;" value="{$lang->cmd_delete}" /></span>
            </form>
        </th>
    </table>

    <!--@end-->

    <div class="button_box">
        <a href="{getSiteUrl($site_module_info->domain, '', 'mid',$module_info->mid)}" class="button"><span>{$lang->cmd_back}</span></a>
    </div>


    <div class="pagination">
        <a href="{getUrl('page','')}" class="prevEnd">{$lang->first_page}</a> 
        <!--@while($page_no = $page_navigation->getNextPage())-->
            <!--@if($page == $page_no)-->
                <strong>{$page_no}</strong> 
            <!--@else-->
                <a href="{getUrl('page',$page_no)}">{$page_no}</a>
            <!--@end-->
        <!--@end-->
        <a href="{getUrl('page',$page_navigation->last_page)}" class="nextEnd">{$lang->last_page}</a>
    </div>

</div>

<!--#include("include.footer.html")-->
